package ink.lovejinhu.leetcode;

/**
 * @author jinhu
 * created 2021-07-23 17:05
 */
public class Solution_0551 {
    public static void main(String[] args) {
        Solution_0551 solution_0551 = new Solution_0551();
        solution_0551.checkRecord("ALL");
    }

    /**
     * @param s
     * @return
     */
    public boolean checkRecord(String s) {
        char[] chars = s.toCharArray();
        int countA = 0;

        int countinueL = 0;
        for (int i = 0; i < chars.length; i++) {
            if (chars[i] == 'P') {
                continue;
            } else if (chars[i] == 'A') {
                countA++;
                if (countA > 1) {
                    return false;
                }
            } else {
                if (i >= chars.length - 2) continue;
                if (chars[i + 1] == 'L' && chars[i + 2] == 'L') {
                    return true;
                }

            }
        }
        return true;
    }
}
